﻿@model WebUI.Models.QizSubject
@using (Ajax.BeginForm(new AjaxOptions()
{
    LoadingElementId="OnLoadingSpan",UpdateTargetId = "ListView",
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "Post",
    OnSuccess = "$('#dialogbox').dialog('close');",
    OnFailure = "OnSiteError"
}))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>随访单信息</legend>
        @Html.HiddenFor(model => model.ID)
        <table width="100%">
            <tr>
                <td>
                    @Html.EditorFor(model => model.Title, "TxtField")
                    @Html.EditorFor(model => model.HospID, "SelField", new { Selects = new SelectList(ViewBag.Hospitals, "HospitalID", "HospName", Model.HospID) })                    
                    @Html.EditorFor(model => model.DepID, "SelField", new { Selects = new SelectList(ViewBag.Departments, "DepartmentID", "DepName", Model.DepID) })
                    @Html.EditorFor(model => model.CreatorID, "SelField", new { Selects = new SelectList(ViewBag.Users, "UserID", "UserName", Model.CreatorID) })
                    @Html.EditorFor(model => model.OwnerID, "SelField", new { Selects = new SelectList(ViewBag.Users, "UserID", "UserName", Model.OwnerID) })
                    <br />
                    <strong>@Html.CheckBox("IsInitFromTemplate", false, new { id = "IsInitFromTemplate", onclick = "document.getElementById('QizTemplateIDSel').disabled=!this.checked;" })
                        <label for="IsInitFromTemplate">
                            直接从模板初始化次随访单</label></strong><br />
                    @Html.DropDownList("QizTemplateID", new SelectList(ViewBag.Templates, "QizFormTemplateID", "Title"), new { id = "QizTemplateIDSel",disabled="disabled" })
                </td>
                <td>
                    @Html.EditorFor(model => model.StatusID, "StsField")
                    @Html.EditorFor(model => model.CreateTime, "TxtField")
                    @Html.EditorFor(model => model.Tag, "TxtField")
                    @Html.EditorFor(model => model.ActionInterval, "TxtField")
                </td>
            </tr>
        </table>
        <p>
            <input type="submit" value="确定" />
        </p>
    </fieldset>
}